package com.job.ZhangMeng.Homework0712;

import java.util.Scanner;

//测试环境
public class TestTiger {

    public static void main(String[] args) {
        Tiger tiger= new Tiger();
        Scanner ch=new Scanner(System.in);
        while(true)//策略模式(每个策略都单独封装class)
        {
            System.out.print("请输入创建方式(1/2/3/exit)：");
            String str=ch.next();
            if(str.equals("exit"))
                return;
            else if(str.equals("1"))//老年虎
            {
                tiger=AttackMethods.chooseMethod(1);
                tiger.attack();
            }
            else if(str.equals("2"))//青年虎
            {
                tiger=AttackMethods.chooseMethod(2);
                tiger.attack();
            }
            else if(str.equals("3"))//幼年虎
            {
                tiger=AttackMethods.chooseMethod(3);
                tiger.attack();
            }
            else
            {
                tiger=AttackMethods.chooseMethod(100);
                tiger.attack();
            }
        }
    }

}
